package com.xiangyun.xyojbackendquestionservice.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xiangyun.xyojbackendmodel.dto.questionsubmit.QuestionSubmitAddRequest;
import com.xiangyun.xyojbackendmodel.dto.questionsubmit.QuestionSubmitQueryRequest;
import com.xiangyun.xyojbackendmodel.entity.QuestionSubmit;
import com.xiangyun.xyojbackendmodel.entity.User;
import com.xiangyun.xyojbackendmodel.vo.QuestionSubmitVO;
import com.xiangyun.xyojbackendmodel.vo.UserVO;

/**
* @author Xiangyun
* @description 针对表【question_submit(题目提交)】的数据库操作Service
* @createDate 2025-04-16 19:17:16
*/
public interface QuestionSubmitService extends IService<QuestionSubmit> {

    /**
     * 提交题目
     *
     * @param questionId
     * @param loginUser
     * @return
     */
    long doQuestionSubmit(QuestionSubmitAddRequest questionId, User loginUser);

    /**
     * 获取查询条件
     *
     * @param questionSubmitQueryRequest
     * @return
     */
    QueryWrapper<QuestionSubmit> getQueryWrapper(QuestionSubmitQueryRequest questionSubmitQueryRequest);

    /**
     * 获取帖子封装
     *
     * @param question
     * @return
     */
    QuestionSubmitVO getQuestionSubmitVO(QuestionSubmit question, User loginUser);

    /**
     * 分页获取帖子封装
     *
     * @param questionSubmitPagePage
     * @param loginUser
     * @return
     */
    Page<QuestionSubmitVO> getQuestionSubmitVOPage(Page<QuestionSubmit> questionSubmitPagePage, User loginUser);

    /**
     * 获取我的提交历史
     *
     * @param questionSubmitQueryRequest
     * @param loginUser
     * @return
     */
    Page<QuestionSubmitVO> listMyQuestionSubmitByPage(QuestionSubmitQueryRequest questionSubmitQueryRequest,
                                                      User loginUser);
}
